package task11;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-09-23
 * Time:18:00
 */
public class Demo3 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=1;
        int count=0;
        int max=9;
        while (true){
            for (int i = 0; i < max; i++) {
                count+=k;
                n--;
                if(n==0){
                    break;
                }
            }
            if(n==0){
                break;
            }
            max-=1;
            k*=10;
        }
        System.out.println(count);

    }
}
